﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace HDJ.Framework.Core
{
    public static class WorldUtils 
    {
        public static T AddWorldMonoComponent<T>(this GameObject gameObject, World world ) where T :WorldMonoObjectBase
        {
            T t = gameObject.AddComponent<T>();
            t.SetWorld(world);
            return t;
        }
        public static T AddWorldMonoComponent<T>(this Transform  transform, World world) where T : WorldMonoObjectBase
        {
            return AddWorldMonoComponent<T>(transform.gameObject,world);
        }
    }
}
